package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.DotificationPictures;
import com.ruoyi.common.core.domain.entity.UserData;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.mapper.DotificationPicturesMapper;
import com.ruoyi.system.mapper.UserDataMapper;
import com.ruoyi.system.service.IDotificationPicturesService;
import com.ruoyi.system.service.IUserDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * 公告 服务层实现
 * 
 * @author ruoyi
 */
@Service
public class UserDataServiceImpl implements IUserDataService
{
    @Autowired
    private UserDataMapper userDataMapper;

    @Override
    public List<UserData> selectList(UserData userData) {
        return userDataMapper.selectList(userData);
    }

    @Override
    public int save(List<UserData> list) {
        for (int i = 0; i < list.size(); i++) {
            if(list.get(i).getId()!=null ){
                //修改
                userDataMapper.update(list.get(i));
            }else{
                userDataMapper.save(list.get(i));
            }
        }
        return 1;
    }
}
